home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / X11 / XDrawText.z / XDrawText
Encoding:
Text File  |  2002-10-03  |  7.5 KB  |  199 lines

  1.  
  2.  
  3.  
  4.      XXXXDDDDrrrraaaawwwwTTTTeeeexxxxtttt((((3333XXXX11111111))))    XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))     XXXXDDDDrrrraaaawwwwTTTTeeeexxxxtttt((((3333XXXX11111111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           XDrawText, XDrawText16, XTextItem, XTextItem16 - draw
  10.           polytext text and text drawing structures
  11.  
  12.      SSSSYYYYNNNNTTTTAAAAXXXX
  13.           XDrawText(_d_i_s_p_l_a_y, _d, _g_c, _x, _y, _i_t_e_m_s, _n_i_t_e_m_s)
  14.                 Display *_d_i_s_p_l_a_y;
  15.                 Drawable _d;
  16.                 GC _g_c;
  17.                 int _x, _y;
  18.                 XTextItem *_i_t_e_m_s;
  19.                 int _n_i_t_e_m_s;
  20.  
  21.           XDrawText16(_d_i_s_p_l_a_y, _d, _g_c, _x, _y, _i_t_e_m_s, _n_i_t_e_m_s)
  22.                 Display *_d_i_s_p_l_a_y;
  23.                 Drawable _d;
  24.                 GC _g_c;
  25.                 int _x, _y;
  26.                 XTextItem16 *_i_t_e_m_s;
  27.                 int _n_i_t_e_m_s;
  28.  
  29.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  30.           _d         Specifies the drawable.
  31.  
  32.           _d_i_s_p_l_a_y   Specifies the connection to the X server.
  33.  
  34.           _g_c        Specifies the GC.
  35.  
  36.           _i_t_e_m_s     Specifies an array of text items.
  37.  
  38.           _n_i_t_e_m_s    Specifies the number of text items in the array.
  39.  
  40.           _x
  41.           _y         Specify the x and y coordinates, which are
  42.                     relative to the origin of the specified drawable
  43.                     and define the origin of the first character.
  44.  
  45.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  46.           The _X_D_r_a_w_T_e_x_t_1_6 function is similar to _X_D_r_a_w_T_e_x_t except that
  47.           it uses 2-byte or 16-bit characters.  Both functions allow
  48.           complex spacing and font shifts between counted strings.
  49.  
  50.           Each text item is processed in turn.  A font member other
  51.           than _N_o_n_e in an item causes the font to be stored in the GC
  52.           and used for subsequent text. A text element delta specifies
  53.           an additional change in the position along the x axis before
  54.           the string is drawn. The delta is always added to the
  55.           character origin and is not dependent on any characteristics
  56.           of the font.  Each character image, as defined by the font
  57.           in the GC, is treated as an additional mask for a fill
  58.           operation on the drawable.  The drawable is modified only
  59.           where the font character has a bit set to 1.  If a text item
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 10/3/02)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXDDDDrrrraaaawwwwTTTTeeeexxxxtttt((((3333XXXX11111111))))    XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))     XXXXDDDDrrrraaaawwwwTTTTeeeexxxxtttt((((3333XXXX11111111))))
  71.  
  72.  
  73.  
  74.           generates a _B_a_d_F_o_n_t error, the previous text items may have
  75.           been drawn.
  76.  
  77.           For fonts defined with linear indexing rather than 2-byte
  78.           matrix indexing, each _X_C_h_a_r_2_b structure is interpreted as a
  79.           16-bit number with byte1 as the most significant byte.
  80.  
  81.           Both functions use these GC components:  function, plane-
  82.           mask, fill-style, font, subwindow-mode, clip-x-origin,
  83.           clip-y-origin, and clip-mask.  They also use these GC mode-
  84.           dependent components: foreground, background, tile, stipple,
  85.           tile-stipple-x-origin, and tile-stipple-y-origin.
  86.  
  87.           _X_D_r_a_w_T_e_x_t and _X_D_r_a_w_T_e_x_t_1_6 can generate _B_a_d_D_r_a_w_a_b_l_e, _B_a_d_F_o_n_t,
  88.           _B_a_d_G_C, and _B_a_d_M_a_t_c_h errors.
  89.  
  90.      SSSSTTTTRRRRUUUUCCCCTTTTUUUURRRREEEESSSS
  91.           The _X_T_e_x_t_I_t_e_m and _X_T_e_x_t_I_t_e_m_1_6 structures contain:
  92.  
  93.           typedef struct {
  94.                char *chars;             /* pointer to string */
  95.                int nchars;              /* number of characters */
  96.                int delta;               /* delta between strings */
  97.                Font font;               /* Font to print it in, None don't change */
  98.           } XTextItem;
  99.  
  100.           typedef struct {
  101.                XChar2b *chars;          /* pointer to two-byte characters */
  102.                int nchars;              /* number of characters */
  103.                int delta;               /* delta between strings */
  104.                Font font;               /* font to print it in, None don't change */
  105.           } XTextItem16;
  106.  
  107.           If the font member is not _N_o_n_e, the font is changed before
  108.           printing and also is stored in the GC.  If an error was
  109.           generated during text drawing, the previous items may have
  110.           been drawn.  The baseline of the characters are drawn
  111.           starting at the x and y coordinates that you pass in the
  112.           text drawing functions.
  113.  
  114.           For example, consider the background rectangle drawn by
  115.           _X_D_r_a_w_I_m_a_g_e_S_t_r_i_n_g.  If you want the upper-left corner of the
  116.           background rectangle to be at pixel coordinate (x,y), pass
  117.           the (x,y + ascent) as the baseline origin coordinates to the
  118.           text functions.  The ascent is the font ascent, as given in
  119.           the _X_F_o_n_t_S_t_r_u_c_t structure.  If you want the lower-left
  120.           corner of the background rectangle to be at pixel coordinate
  121.           (x,y), pass the (x,y - descent + 1) as the baseline origin
  122.           coordinates to the text functions.  The descent is the font
  123.           descent, as given in the _X_F_o_n_t_S_t_r_u_c_t structure.
  124.  
  125.      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  126.  
  127.  
  128.  
  129.      PPPPaaaaggggeeee 2222                                          ((((pppprrrriiiinnnntttteeeedddd 11110000////3333////00002222))))
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      XXXXDDDDrrrraaaawwwwTTTTeeeexxxxtttt((((3333XXXX11111111))))    XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))     XXXXDDDDrrrraaaawwwwTTTTeeeexxxxtttt((((3333XXXX11111111))))
  137.  
  138.  
  139.  
  140.           _B_a_d_D_r_a_w_a_b_l_e
  141.                     A value for a Drawable argument does not name a
  142.                     defined Window or Pixmap.
  143.  
  144.           _B_a_d_F_o_n_t   A value for a Font or GContext argument does not
  145.                     name a defined Font.
  146.  
  147.           _B_a_d_G_C     A value for a GContext argument does not name a
  148.                     defined GContext.
  149.  
  150.           _B_a_d_M_a_t_c_h  An _I_n_p_u_t_O_n_l_y window is used as a Drawable.
  151.  
  152.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  153.           XDrawImageString(3X11), XDrawString(3X11), XLoadFont(3X11)
  154.           _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 10/3/02)
  196.  
  197.  
  198.  
  199.